import cv2 as cv

img = cv.imread('data/messi5.jpg')
if img is None:
    print("[ERROR] fail to read Image!!!")
    exit(0)

b,g,r = cv.split(img)

cv.imshow("pic", b)
cv.waitKey(0)
cv.imshow("pic", g)
cv.waitKey(0)
cv.imshow("pic", r)
cv.waitKey(0)

mergeImg = cv.merge((b,g,r))
cv.imshow("pic", mergeImg)
cv.waitKey(0)

cv.destroyAllWindows()